package org.tis.tools.abf.module.ac.service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import org.tis.tools.abf.module.ac.controller.request.AcDeleteListRequest;
import org.tis.tools.abf.module.ac.controller.request.AcRoleAddRequest;
import org.tis.tools.abf.module.ac.controller.request.AcRoleMoveRequest;
import org.tis.tools.abf.module.ac.controller.request.AcRoleTreeFilterRequest;
import org.tis.tools.abf.module.ac.entity.AcRole;
import org.tis.tools.abf.module.ac.exception.AcRoleManagementException;

import java.util.List;


/**
 * acRole的Service接口类
 * 
 * @author Auto Generate Tools
 * @date 2018/04/23
 */
public interface IAcRoleService extends IService<AcRole>{


    /**
     * <pre>
     * 根据条件查询角色
     * </pre>
     *
     * @param acRole
     *
     * @return 匹配的角色
     *
     * @throws AcRoleManagementException
     */
    AcRole queryByCondition(AcRole acRole)throws AcRoleManagementException;




    /**
     * <pre>
     * 新建一个角色
     *
     * @return 新建角色信息
     * @throws AcRoleManagementException
     */
    AcRole createAcRole(AcRoleAddRequest request) throws AcRoleManagementException;

    /**
     * <pre>
     * 修改一个角色
     *
     *
     * </pre>
     *
     * @param acRole
     *
     * @return 修改角色信息
     * @throws AcRoleManagementException
     */
    boolean updateAcRole(AcRole acRole) throws AcRoleManagementException;

    /**
     * <pre>
     * 根据roleCode删除一个角色
     *
     *
     * </pre>
     *
     * @param id
     *
     * @return 删除角色信息
     * @throws AcRoleManagementException
     */
    boolean deleteByRoleCode(String id) throws AcRoleManagementException;

    /**
     * 批量删除
     * @param listRequest
     * @throws AcRoleManagementException
     */
    void batchDelete(AcDeleteListRequest listRequest) throws AcRoleManagementException;

    /**
     * 查询角色树
     * @return
     * @throws AcRoleManagementException
     */
    List<Object> queryRoleTree() throws AcRoleManagementException;

    /**
     * 根据条件查询角色树
     * @return
     * @throws AcRoleManagementException
     */
    List<Object> queryRoleTreeFilter(AcRoleTreeFilterRequest treeFilterRequest) throws AcRoleManagementException;

    /**
     * 根据条件查询操作员下的角色
     * @param operatorId
     * @param page
     * @param wrapper
     * @return
     * @throws AcRoleManagementException
     */
    Page<AcRole> queryByOperator(String operatorId, Page<AcRole> page, EntityWrapper<AcRole> wrapper)throws
            AcRoleManagementException;

    /**
     * 根据角色分组查询角色
     * @param roleGroup
     * @return
     * @throws AcRoleManagementException
     */
    List<AcRole> queryRolesByGroup(String roleGroup)throws AcRoleManagementException;

    /**
     * 启用角色
     * @param id
     * @return
     * @throws AcRoleManagementException
     */
    AcRole enableRole(String id)throws AcRoleManagementException;

    /**
     * 停用角色
     * @param id
     * @return
     * @throws AcRoleManagementException
     */
    AcRole disableRole(String id)throws AcRoleManagementException;

    /**
     * 判断角色代码是否已经存在
     * @param roleCode
     * @return
     * @throws AcRoleManagementException
     */
    Boolean existRoleCode(String roleCode)throws AcRoleManagementException;

    /**
     * 判断修改角色代码是否已经存在
     */
    Boolean existUpdateRoleCode(String roleCode,String  guid)throws AcRoleManagementException;

    /**
     * 角色移动
     */
    void moveRoleToGroup(AcRoleMoveRequest acRoleMoveRequest)throws AcRoleManagementException;
}

